/**
 * Created with File
 * Author: Chuans
 * Github: https://github.com/chuans
 * Date: 2018/9/6
 * Time: 下午5:00
 */

import {Input} from 'antd';
import {CoinStatus, CoinType,CoinTarget} from '../../enum/coins'


export const searchForm: any[] = [{
    key: 'nick_name',
    Component: Input,
    label: '昵称',
    props: {
        placeholder: '请输入昵称查询'
    }
}, {
    key: 'phone',
    Component: Input,
    label: '电话号码',
    props: {
        placeholder: '请输入电话号码查询'
    }
}, {
    key: 'type',
    Component: 'Select',
    initialValue: '',
    selectList: [{
        value: '',
        name: '全部'
    }, {
        value: 'handsel_system',
        name: CoinType.handsel_system
    }, {
        value: 'handsel_register',
        name: CoinType.handsel_register
    }, {
        value: 'compensate_system',
        name: CoinType.handsel_system
    }, {
        value: 'subtract_system',
        name: CoinType.subtract_system
    }],
    label: '操作类型',
    props: {
        placeholder: '选择操作类型'
    }
},{
    key: 'target',
    Component: 'Select',
    initialValue: '',
    selectList: [{
        value: '',
        name: '全部'
    }, {
        value: 'assign',
        name: CoinTarget.assign
    }, {
        value: 'all',
        name: CoinTarget.all
    }],
    label: '操作对象'
}];


export const editForm = () => {
    return [{
        key: 'coin',
        Component: Input,
        label: '操作数量',
        initialValue: '',
        rules: [
            {required: true, message: '请输入操作的数量!'},

        ],
        props: {
            type: 'number',
            placeholder: '请输入操作数量'
        }
    }, {
        key: 'message',
        Component: Input.TextArea,
        label: '操作说明',
        initialValue: '',
        rules: [
            {required: true, message: '请输入操作说明!'},
        ],
        props: {
            type: 'text',
            autosize: {minRows: 5},
            placeholder: '请输入操作说明'
        }
    },{
        key: 'notification_msg',
        Component: Input.TextArea,
        label: '消息通知说明',
        initialValue: '',
        rules: [
            {required: true, message: '请输入消息通知介绍!'},
        ],
        props: {
            type: 'text',
            autosize: {minRows: 5},
            placeholder: '请输消息通知'
        }
    }, {
        key: 'type',
        Component: 'Select',
        initialValue: 'handsel_system',
        label: '操作类型',
        selectList: [{
            value: 'handsel_system',
            name: CoinType.handsel_system
        }, {
            value: 'handsel_register',
            name: CoinType.handsel_register
        }, {
            value: 'compensate_system',
            name: CoinType.handsel_system
        }, {
            value: 'subtract_system',
            name: CoinType.subtract_system
        }],
        props: {
            placeholder: '选择此次操作类型',
        }
    }, {
        key: 'status',
        Component: 'Select',
        initialValue: 'add',
        label: '操作类型',
        selectList: [{
            value: 'add',
            name: CoinStatus.add
        }, {
            value: 'subtract',
            name: CoinStatus.subtract
        }],
        props: {
            placeholder: '选择此次操作状态',
        }
    }]
}
